package main

import "fmt"

/**
- [图解panic & recover](https://mp.weixin.qq.com/s/vcJ6TsnknaCoYhH6XZnNMw)
*/
func main() {
	A()
}

func A() {
	defer A1()
	panic("panicA")
}
func A1() {
	fmt.Println("A1再次panic")
	panic("panicA1")
}

/**
output:
A1再次panic
panic: panicA
        panic: panicA1

goroutine 1 [running]:
main.A1()
        /root/code/go/basic/eggo/panic/demo02/main.go:15 +0x65
panic({0x485e60, 0x4b2b50})
        /usr/lib/go-1.18/src/runtime/panic.go:838 +0x207
main.A()
        /root/code/go/basic/eggo/panic/demo02/main.go:11 +0x49
main.main()
        /root/code/go/basic/eggo/panic/demo02/main.go:6 +0x17
exit status 2

*/
